package com.autolinq.util;

import net.sf.json.JSONObject;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.util.EntityUtils;

import com.autolinq.util.http.HttpClientConnectionManager;
import com.autolinq.util.http.HttpPostMessage;
  
public class MenuUtil {  
  
    public static String APPID,APPSECRET;  
      
    //http客户端    
    public static DefaultHttpClient httpclient;  
      
    static {    
        httpclient = new DefaultHttpClient(new ThreadSafeClientConnManager());    
        httpclient = (DefaultHttpClient) HttpClientConnectionManager.getSSLInstance(httpclient); // 接受任何证书的浏览器客户端  
        APPID = "wxd9a94803cacf5b48";//你的APPID  
        APPSECRET = "c358ce24e3575168267b2ee643ddce27"; //你的APPSECRET  
    }    
//	String accessToken = MenuUtil.getAccessToken(APPID, APPSECRET);
//	//Authorize device process
//	JSONObject authoJson = JSONObject.fromObject(MenuUtil.authDevice(generateAuthorizeJson(deviceId), accessToken));
//	String errcode = "";
//	try{
//		errcode = authoJson.getJSONArray("resp").getJSONObject(0).get("errcode").toString();
//	}catch(Exception ex){
//		log.debug(ex.toString());
//		errcode = authoJson.get("errcode").toString();
//	}
//	if("0".equals(errcode)){
//		//handle get QRCode process
//		JSONObject demoJson = JSONObject.fromObject(MenuUtil.createQRCode(generateQRCodeJson(deviceId), accessToken));
//    	String errcodeQRCode = demoJson.get("errcode").toString();
//    	if("0".equals(errcodeQRCode)){
//    		Object obj = demoJson.getJSONArray("code_list").getJSONObject(0).get("ticket");
//    		String ticket = obj.toString();
//    		QRCode qrcode = new QRCode();
//    		String filePostfix="png";
//    		File file = new File(qrcodePath+"oauth_QR_CODE_"+deviceId+"."+filePostfix);
//    		qrcode.encode(ticket, file,filePostfix, BarcodeFormat.QR_CODE, 300, 300, null);
//    		
//    		String message = "{errcode:0,errmesage:\"\",qrcode:\""+"qrcode/"+"oauth_QR_CODE_"+deviceId+"."+filePostfix+"\"}";
//    		printMessageSave(request,response,message);
//    		return;
//    	}
//	}else{
//		String message = "{errcode:"+100002+",errmesage:\"deviceId already exist.\"}";
//		printMessageSave(request,response,message);
//	}    
    /** 
     * 创建菜单  
     */  
    public static String createMenu(String params, String accessToken) throws Exception {    
        HttpPost httpost = HttpClientConnectionManager.getPostMethod("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + accessToken);    
        httpost.setEntity(new StringEntity(params, "UTF-8"));    
        HttpResponse response = httpclient.execute(httpost);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.getString("errmsg");  
    }    
    /** 
     * 设备授权
     */  
    public static String authDevice(String params, String accessToken) throws Exception {    
        HttpPost httpost = HttpClientConnectionManager.getPostMethod("https://api.weixin.qq.com/device/authorize_device?access_token=" + accessToken);    
        httpost.setEntity(new StringEntity(params, "UTF-8"));    
        HttpResponse response = httpclient.execute(httpost);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.toString();  
    }  
    
    /** 
     * 设备绑定
     */  
    public static String bindDevice(String params, String accessToken) throws Exception {    
        HttpPost httpost = HttpClientConnectionManager.getPostMethod("https://api.weixin.qq.com/device/bind?access_token=" + accessToken);    
        httpost.setEntity(new StringEntity(params, "UTF-8"));    
        HttpResponse response = httpclient.execute(httpost);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.toString();  
    }  
    
    /** 
     * 获取二维码
     */  
    public static String createQRCode(String params, String accessToken) throws Exception {    
        HttpPost httpost = HttpClientConnectionManager.getPostMethod("https://api.weixin.qq.com/device/create_qrcode?access_token=" + accessToken);    
        httpost.setEntity(new StringEntity(params, "UTF-8"));    
        HttpResponse response = httpclient.execute(httpost);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.toString();  
    }
    /** 
     * 获取accessToken  
     */  
    public static String getAccessToken(String appid, String secret) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret);    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");  
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.getString("access_token");  
    }    
    /** 
     * 获取getTicket  
     */  
    public static String getTicket(String accessToken) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token="+accessToken+"&type=jsapi");    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");  
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.getString("ticket");  
    }  
    /** 
     * 查询菜单 
     */  
    public static String getMenuInfo(String accessToken) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("https://api.weixin.qq.com/cgi-bin/menu/get?access_token=" + accessToken);    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        return jsonStr;    
    }   
    
    /** 
     * 查询菜单 
     */  
    public static String getOpenIds(String accessToken) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("https://api.weixin.qq.com/cgi-bin/user/get?next_openid=&access_token=" + accessToken);    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        return jsonStr;    
    }  
    
    public static String getUserInfo(String accessToken,String openId) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + accessToken+"&openid="+openId+"&lang=zh_CN");    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        return jsonStr;    
    } 
      
    /**  
     * 删除菜单  
     */    
    public static String deleteMenuInfo(String accessToken) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=" + accessToken);    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        JSONObject demoJson = JSONObject.fromObject(jsonStr);  
        return demoJson.getString("errmsg");    
    }    
    
    public static String postInfo(String params, String accessToken) throws Exception {       
        HttpPost httpost = HttpClientConnectionManager.getPostMethod("https://api.weixin.qq.com/device/transmsg?access_token=" + accessToken);    
        httpost.setEntity(new StringEntity(params, "UTF-8"));    
        HttpResponse response = httpclient.execute(httpost);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");    
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.toString();    
    }   
    
    /** 
     * 获取accessToken  
     */  
    public static String downloadVoice(String accessToken, String voiceId) throws Exception {    
        HttpGet get = HttpClientConnectionManager.getGetMethod("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + voiceId);    
        HttpResponse response = httpclient.execute(get);    
        String jsonStr = EntityUtils.toString(response.getEntity(), "utf-8");  
        JSONObject demoJson = JSONObject.fromObject(jsonStr);
        return demoJson.getString("access_token");  
    }
      
   /* 
    * 测试 
    */  
    public static void main(String[] args) {  
  
        StringBuffer sb = new StringBuffer();  
        sb.append("{");  
        sb.append(" \"button\":[");  
        sb.append("     {");  
        sb.append("         \"type\":\"click\",");  
        sb.append("         \"name\":\"旅程\",");  
        sb.append("         \"key\":\"trip\"");   
        sb.append("     },");  
        sb.append("     {");  
        sb.append("         \"type\":\"click\",");  
        sb.append("         \"name\":\"搭车\",");  
        sb.append("         \"key\":\"pickup\"");   
        sb.append("     },"); 
//        sb.append("     {");  
//        sb.append("         \"name\":\"搭车\",");  
//        sb.append("         \"sub_button\":[");  
//        sb.append("             {");  
//        sb.append("                 \"type\":\"click\",");  
//        sb.append("                 \"name\":\"我的搭车\",");  
//        sb.append("                 \"key\":\"myPickup\"");  
//        sb.append("             },");  
//        sb.append("             {");  
//        sb.append("                 \"type\":\"view\",");  
//        sb.append("                 \"name\":\"创建搭车\",");  
//        sb.append("                 \"url\":\"http://demo.open.weixin.qq.com/jssdk/#menu-share\"");    //连接地址  
//        sb.append("             }");  
//        sb.append("         ]");  
//        sb.append("     },");  
//        sb.append("     {");  
//        sb.append("         \"name\":\"我的\",");             //URL 连接  
//        sb.append("         \"sub_button\":[");  
//        sb.append("             {");  
//        sb.append("                 \"type\":\"view\",");  
//        sb.append("                 \"name\":\"好友列表\",");  
//        //sb.append("                 \"url\":\"http://114.141.164.151/DP/TripMap?tripID=145&openID=ogK2Fjpr22CvUXl8Q0eMHC8LcJTA&headImgUrl=http://wx.qlogo.cn/mmopen/FpflLl4VVYhKneKpuI6cgytEhm2FAHGrhvLUBu7at67wJtYyZXPEE4XBcWus2TDGhkps6CQXSjcuwibhtkuQeEcBTXnHZV5ak/0&city=\",");    //连接地址  
//        //sb.append("                 \"url\":\"http://203.195.191.112/device/\",");    //连接地址  
//        sb.append("                 \"url\":\"http://115.28.109.130/autoLinQ/auto2.html\","); 
//        sb.append("             }");  
//        sb.append("         ]");  
//        sb.append("     }");  
        sb.append("     {");  
        sb.append("         \"type\":\"click\",");  
        sb.append("         \"name\":\"我的\",");  
        sb.append("         \"key\":\"mine\"");   
        sb.append("     }");  
        sb.append(" ]");  
        sb.append("}");  
        
        StringBuffer ssb = new StringBuffer();
        ssb.append("{ ");
        ssb.append("\"device_num\":\"1\",");
        ssb.append("\"device_list\":[ ");
        ssb.append("{");
        ssb.append("\"id\":\"1A32267BA1221810\",");
        ssb.append("\"mac\":\"00025B88160A\",");
        ssb.append("\"connect_protocol\":\"1|2\",");
        ssb.append("\"auth_key\":\"\",");
        ssb.append("\"close_strategy\":\"2\",");
        ssb.append("\"conn_strategy\":\"1\",");
        ssb.append("\"crypt_method\":\"0\",");
        ssb.append("\"auth_ver\":\"0\",");
        ssb.append("\"manu_mac_pos\":\"-1\",");
        ssb.append("\"ser_mac_pos\":\"-2\"}], ");
        ssb.append("\"op_type\":\"1\" ");
        ssb.append("} ");
        
        StringBuffer sbqrcode = new StringBuffer();
        sbqrcode.append("{ ");
        sbqrcode.append("\"device_num\":\"1\",");
        sbqrcode.append("\"device_id_list\":[\"1A32267BA0AB11221283\"] ");
        sbqrcode.append("} ");
        
        StringBuffer bindreq = new StringBuffer();
        bindreq.append("{ ");
        bindreq.append("\"ticket\":\"1329158318732602\",");
        bindreq.append("\"device_id\":\"1A32267BA1221809\",");
        bindreq.append("\"openid\":\"ojEq7uDpYTK8f926MBc6hATaWe00\"");
        bindreq.append("} ");

          
        try {  
            // 获取accessToken -参数appid，secret   
        	String s = "001583B3FBAD";  
        	String s1 = Long.toString(Long.parseLong(s, 16));  
        	
            String accessToken = HttpPostMessage.readContentFromGet("http://115.28.109.130/contiCar/rest/passport/token/", "");    
            accessToken = (JSONObject.fromObject(accessToken)).getString("token");
  //      	String accessToken = getAccessToken(APPID,APPSECRET);
            String res="";  
            res = bindDevice(bindreq.toString(),accessToken);
        //    res = getUserInfo(accessToken,"ojEq7uNcq817dFKPkWz1xyIUEZkI");
            //res = downloadVoice("xYPLqTbFGb9tiIcKVzfiyMbU2C32AuTN3AgMiMRlKDc5z83DwJBT0R6kc0scqpm6BqYcITIZ7Vo41ZOg62bI1WTQfxoyfh8bEyxAkbRnVgY","BQzIPRmhjuofaUk2qxypwQnOSjL3S0b7OhDrG4AVYm2MmtOzpucoTt3WTSYYYeVO");
       //     res = deleteMenuInfo(accessToken);
       //     res = createMenu(sb.toString(), accessToken);   
       //     res = getMenuInfo(accessToken);
      //      res = getOpenIds(accessToken);
       //     res = authDevice(ssb.toString(),accessToken);
       //    res = createQRCode(sbqrcode.toString(),accessToken);
            System.out.println(res);  
//        	String jsonStr = "{\"resp\":[{\"base_info\":{\"device_type\":\"gh_a7788e95675b\",\"device_id\":\"1A32267BA0AB11221111\"},\"errcode\":0,\"errmsg\":\"ok\"}]}";
//        	JSONObject demoJson = JSONObject.fromObject(jsonStr);
//        	demoJson.isArray();
//        	String errcode = demoJson.getJSONArray("resp").getJSONObject(0).get("errcode").toString();
//        	Object obj = demoJson.getJSONArray("resp").getJSONObject(0).get("errcode");
        	
//            StringBuffer msg = new StringBuffer();
//            msg.append("{ ");
//            msg.append("\"device_type\":\"gh_f11e546c06f4\", ");
//            msg.append("\"device_id\":\"1A32267BA1221809\", ");
//            msg.append("\"open_id\":\"ojEq7uGR9TsrFoGeB1nKqHWazZy4\", ");
//            msg.append("\"content\":\"eyJBcHBJRCI6IkNvRHJpdmVHTXNnIiwiRnVuY0lEIjoiR3JvdXBNc2dOdGZ5IiwiQXBwVmVyc2lvbiI6IlYxLjAwIiwiVGltZVN0YW1wIjoiMjAxNTA0MTUxNDEzNDA5MyIsIlNlc3Npb25JRCI6MCwiRGF0YSI6eyJNc2dJRCI6IjIxOCIsIkdyb3VwVHlwZSI6IkNvRHJpdmUiLCJTZW5kZXJJRCI6Im9qRXE3dUQzQ3JPU0REbGFHdXlpbDRrWk4wQXciLCJQa2dJRCI6IkNvRHJpdmVfMjE4IiwiUGtnSW5kZXgiOjEsIlBrZ051bSI6MSwiVm9pY2VNc2ciOiJBQUFBSEdaMGVYQXpaM0EwQUFBQ0FHbHpiMjFwYzI4eU0yZHdOQUFBQUFobWNtVmxBQUFXZ20xa1lYVGVOZ0FBYkdsaVptRmhZeUF4TGpJMkxqRWdLRTV2ZGlBeE5DQXlNREV3S1NCVlRsTlVRVUpNUlFBQUFpQ21JR0JNdEJNTkZrSkJtTnozRExaZFZ4cjExelhXS2tackpTU0pBdVA0K01ad1E3TnM2ZkQzWmVVL3kvdW9DeXZsNytxeC9MUm0vZjFOTGQxYmY3dHlRRlVzdS9xYng2UGxsbGsyY3UveTlVQkdVOTNsLzNxUlJ1YnNsQTlBTWNzK3AvRC93S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UpHUnBibVlBQUFBY1pISmxaZ0FBQUFBQUFBQUJBQUFBREhWeWJDQUFBQUFCQUFBQmczTjBZbXdBQUFCYmMzUnpaQUFBQUFBQUFBQUJBQUFBUzIxd05HRUFBQUFBQUFBQUFRQUFBQUFBQUFBQUFBSUFFQUFBQUFBZlFBQUFBQUFBSjJWelpITUFBQUFBQXhrQUFRQUVFVUFWQUFBQUFBQXlBQUFBQUFBRkFoV0lCZ0VDQUFBQUdITjBkSE1BQUFBQUFBQUFBUUFBQUJrQUFBUUFBQUFBSEhOMGMyTUFBQUFBQUFBQUFRQUFBQUVBQUFBQkFBQUFBUUFBQUhoemRITjZBQUFBQUFBQUFBQUFBQUFaQUFBQk1nQUFBUXNBQUFFSEFBQUJKUUFBQVRjQUFBRW5BQUFBaVFBQUFMSUFBQUM5QUFBQXV3QUFBTVFBQUFDL0FBQUF3d0FBQUxJQUFBQ3pBQUFBMEFBQUFQMEFBQUQ1QUFBQTlnQUFBUEFBQUFEN0FBQUE4QUFBQVBZQUFBRGxBQUFBNHdBQUFIUnpkR052QUFBQUFBQUFBQmtBQUFBc0FBQUJYZ0FBQW1rQUFBTndBQUFFbFFBQUJjd0FBQWJ6QUFBSGZBQUFDQzRBQUFqckFBQUpwZ0FBQ21vQUFBc3BBQUFMN0FBQURKNEFBQTFSQUFBT0lRQUFEeDRBQUJBWEFBQVJEUUFBRWYwQUFCTDRBQUFUNkFBQUZONEFBQlhEIn19\"");
//            msg.append("} ");
//            System.out.println(msg.toString());
//            res = postInfo(msg.toString(),accessToken);
            
//          StringBuffer msg = new StringBuffer();
//          msg.append("{ ");
//          msg.append("\"device_type\":\"gh_a7788e95675b\", ");
//          msg.append("\"device_id\":\"1A32267BA0AB11221283\", ");
//          msg.append("\"open_id\":\"o_73Ajp76VzaNvDy_riVkJWQkpgA\", ");
//          msg.append("\"content\":\"ewogICAgIkFwcElEIjogIkNvRHJpdmVHTXNnIiwKICAgICJGdW5jSUQiOiAiR3JvdXBNc2dOdGZ5I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SIKICAgIH0KfQo=\"");
//          msg.append("} ");
//          System.out.println(msg.toString());
//          res = postInfo(msg.toString(),accessToken);
//
//        	String jsonStr = "{\"errcode\":0,\"errmsg\":\"ok\",\"device_num\":1,\"code_list\":[{\"device_id\":\"1A32267BA0AB1122\",\"ticket\":\"http://we.qq.com/d/AQD-vcCOzcFJqGvFijAnRL_A9No1Q2bEWk22XOlj\"}]}";
//        	JSONObject demoJson = JSONObject.fromObject(jsonStr);
//        	String errcode = demoJson.get("errcode").toString();
//        	if("0".equals(errcode)){
//        		Object obj = demoJson.getJSONArray("code_list").getJSONObject(0).get("ticket");
//        	}
        	
        } catch (Exception e) {  
            e.printStackTrace();  
        }  
  
    }  
  
}  